package com.runa.monitor.platinterface.extend.third.newester.util;

import com.alibaba.fastjson.JSONObject;
import com.runa.monitor.platinterface.extend.third.newester.validator.BeanValidator;
import com.runa.monitor.platinterface.extend.third.newester.vo.TemperaturePanelDockingDetailVo;
import org.springframework.util.CollectionUtils;

import java.math.BigDecimal;
import java.util.Map;

public class CheckUtil {
    public static String checkObjectParam(Object object) {
        String message = null;
        Map<String, StringBuilder> validate = BeanValidator.validate(object);
        if (!CollectionUtils.isEmpty(validate)) {
            message = JSONObject.toJSONString(validate);
        }
        return message;
    }

    public static void main(String[] args) {
        TemperaturePanelDockingDetailVo detailVo = new TemperaturePanelDockingDetailVo();
        detailVo.setPlanTime(null);
        detailVo.setMeterSerialNo("1111111111111111111111111111111111");
        detailVo.setTemperature(new BigDecimal("23.3333"));
        System.out.println( CheckUtil.checkObjectParam(detailVo));
    }
}
